home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Sample Code / Devices / RAMDisk 1.4d5 / RamDiskCommon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-07  |  3.4 KB  |  105 lines  |  [TEXT/CWIE]

  1. /*
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    StandardFileIcons: A sample control panel changing behavior of StandardFile.
  5. **
  6. **    by Gordon Sheridan and Jim Luther
  7. **  modified by Brian Bechtel
  8. **
  9. **    File:        RamDiskCommon.h
  10. **
  11. **    Copyright © 1992-1996 Apple Computer, Inc.
  12. **    All rights reserved.
  13. **
  14. **    You may incorporate this sample code into your applications without
  15. **    restriction, though the sample code has been provided "AS IS" and the
  16. **    responsibility for its operation is 100% yours.  However, what you are
  17. **    not permitted to do is to redistribute the source as "DTS Sample Code"
  18. **    after having made changes. If you're going to re-distribute the source,
  19. **    we require that you make it clear in the source that the code was
  20. **    descended from Apple Sample Code, but that you've made changes.
  21. **
  22. ** Change History (most recent first):
  23. ** 
  24. **     <1.4>    970207      Quinn    Renamed to RamDiskCommon.h.  Now only contains stuff
  25. **                                that actually needs to be shared.  The other stuff
  26. **                                has been made private to the corresponding source file.
  27. **     <4>    960807      BL°B    Added DriverGestalt.h, set no OLDROUTINENAMES
  28. **      <3>    10/14/93    JML        Added Panic debug macros and changed preprocessor constants
  29. **                                 to enums.
  30. **      <2>     6/13/93    gs        Move dCtlFlag bits from RamDRVR.c and cleanup header.
  31. **      <1>     8/24/92    gs        first checked in
  32. **/
  33.  
  34. #ifndef OLDROUTINENAMES
  35. #define OLDROUTINENAMES        0
  36. #endif
  37.  
  38. #include <Types.h>
  39.  
  40. #if __DebugVersion
  41.     extern    pascal    void    Panic        (unsigned char *    Message)    = 0xABFF;
  42.     #define PanicIf(condition, message)    if (condition) Panic(message)
  43. #else
  44.     #define Panic(param)
  45.     #define PanicIf(param1,param2)
  46. #endif
  47.  
  48. ///////////////////////////////////////////////////////////////////////////
  49. //
  50. // Our driver specific _Control and _Status code.  Shared between
  51. // the INIT and the DRVR.  Note that by saying we support DriverGestalt
  52. // (in our dctlFlags) we guarantee that (amongst other things) our driver
  53. // won't use control or status code below 128 for private calls.  Hence
  54. // the choice of control codes here.
  55.  
  56. enum {
  57.     setGlobalsCC = 128,        /* copy data pointed to by csParam to driver globals */
  58.     getGlobalsSC = 128        /* return pointer to driver globals */
  59. };
  60.  
  61. ///////////////////////////////////////////////////////////////////////////
  62. //
  63. // Driver globals structure created by INIT and passed to DRVR.
  64.  
  65. struct DrvrGlobals
  66. {
  67.     Ptr            ramDisk;
  68.     long        ramSize;
  69.     short        driveNumber;
  70.     Str255        volumeName;
  71.     long        physicalIcon[kLargeIconSize/4];    /* IMPORTANT: icon and whereString must be  */
  72.     Str255        locationStr;                    /* end-to-end in memory! */
  73.     long        mediaIcon[kLargeIconSize/4];
  74.     Boolean        driveNeedsFlush;
  75.     NumVersion    driverVersion;
  76. };
  77. typedef struct DrvrGlobals DrvrGlobals, *DrvrGlobalsPtr, **DrvrGlobalsHandle;
  78.  
  79. ///////////////////////////////////////////////////////////////////////////
  80. //
  81. // Configuration record, created and put into the resource fork by the cdev,
  82. // read out and used by the INIT.
  83.  
  84. struct ConfigRec
  85. {
  86.     short        install;    /* boolean true/false */
  87.     long        size;
  88.     Str255        volumeName;
  89. };
  90. typedef struct ConfigRec ConfigRec, *ConfigRecPtr, **ConfigRecHandle;
  91.  
  92. ///////////////////////////////////////////////////////////////////////////
  93. //
  94. // Common resource definitions.
  95.  
  96. enum {
  97.     // RDcf
  98.     rConfiguration = 0,                // Resource ID of the 'RDcf' configuration resource.
  99.  
  100.     // STR#
  101.     rStringList        =    -4033,
  102.         strLocationStr        = 1,    /* The "where" string used in the Get Info dialog */
  103.         strDefaultNameStr    = 2        /* The initial default volume name */
  104. };
  105.